package com.assistant.market.modules.market.adapter.web.model;

import com.assistant.market.modules.market.domain.MarketCode;
import com.assistant.market.modules.market.domain.MarketCodeType;
import lombok.Data;

@Data
public class MarketCodeInfo {

    /**
     * id
     */
    private Long id;

    /**
     * 类型
     */
    private MarketCodeType type;

    /**
     * 标题
     */
    private String title;

    /**
     * 备注
     */
    private String remarks;

    /**
     * 内容
     */
    private String content;

    /**
     * 作者
     */
    private String author;

    /**
     * 评论
     */
    private String comments;

    public static MarketCodeInfo createBy(MarketCode marketCode) {
        final MarketCodeInfo marketCodeInfo = new MarketCodeInfo();
        marketCodeInfo.id = marketCode.getId();
        marketCodeInfo.type = marketCode.getType();
        marketCodeInfo.title = marketCode.getTitle();
        marketCodeInfo.remarks = marketCode.getRemarks();
        marketCodeInfo.content = marketCode.getContent();
        marketCodeInfo.author = marketCode.getAuthor();
        marketCodeInfo.comments = marketCode.getComments();
        return marketCodeInfo;
    }
}
